const app = getApp()
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		inTheaters:[],
		
	},

	onLoad: function (options) {
		wx.request({
			url: app.gBaseUrl + 'in_theaters',
			data:{
				start:0,
				count:3
			},
			success:(res) =>{
				this.setData({
					inTheaters:res.data.subjects
				})
			}
		}),
		wx.request({
			url: app.gBaseUrl + 'coming_soon',
			data:{
				start:0,
				count:3
			},
			success:(res) =>{
				this.setData({
					comingSoon:res.data.subjects
				})
			}
		}),
		wx.request({
			url: app.gBaseUrl + 'top250',
			data:{
				start:0,
				count:3
			},
			success:(res) =>{
				this.setData({
					top250:res.data.subjects
				})
			}
		})
	},
	onGoToMore (event) {
		const type =  event.currentTarget.dataset.type
		wx.navigateTo({
			url: '/pages/more-movie/more-movie?type=' + type
		})
	}
})